package com.itheima.listener;

import cn.hutool.core.date.DateUtil;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
@RocketMQMessageListener(consumerGroup = "delay-group",topic = "tanhua-delay")
public class DelayMessageListener implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        System.out.println("当前消费者时间："+ DateUtil.formatDateTime(new Date()));
        System.out.println("消费者接受消息："+message);
    }
}
